package com.zyzd.greendaodemo.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.zyzd.greendaodemo.entity.Student;
import com.zyzd.greendaodemo.entity.SportInfo;
import com.zyzd.greendaodemo.entity.UserInfo;

import com.zyzd.greendaodemo.dao.StudentDao;
import com.zyzd.greendaodemo.dao.SportInfoDao;
import com.zyzd.greendaodemo.dao.UserInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig studentDaoConfig;
    private final DaoConfig sportInfoDaoConfig;
    private final DaoConfig userInfoDaoConfig;

    private final StudentDao studentDao;
    private final SportInfoDao sportInfoDao;
    private final UserInfoDao userInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        studentDaoConfig = daoConfigMap.get(StudentDao.class).clone();
        studentDaoConfig.initIdentityScope(type);

        sportInfoDaoConfig = daoConfigMap.get(SportInfoDao.class).clone();
        sportInfoDaoConfig.initIdentityScope(type);

        userInfoDaoConfig = daoConfigMap.get(UserInfoDao.class).clone();
        userInfoDaoConfig.initIdentityScope(type);

        studentDao = new StudentDao(studentDaoConfig, this);
        sportInfoDao = new SportInfoDao(sportInfoDaoConfig, this);
        userInfoDao = new UserInfoDao(userInfoDaoConfig, this);

        registerDao(Student.class, studentDao);
        registerDao(SportInfo.class, sportInfoDao);
        registerDao(UserInfo.class, userInfoDao);
    }
    
    public void clear() {
        studentDaoConfig.clearIdentityScope();
        sportInfoDaoConfig.clearIdentityScope();
        userInfoDaoConfig.clearIdentityScope();
    }

    public StudentDao getStudentDao() {
        return studentDao;
    }

    public SportInfoDao getSportInfoDao() {
        return sportInfoDao;
    }

    public UserInfoDao getUserInfoDao() {
        return userInfoDao;
    }

}
